package com.example.auth.annotation;

import java.lang.annotation.*;
import java.util.concurrent.TimeUnit;

/**
 * the annotation of redis cache
 * @author cui haida
 */
@Documented
@Target({ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
public @interface RedisCache {
    /**
     * value of redis cache
     */
    String value() default "";

    /**
     * is flush redis cache?, default false
     */
    boolean flush() default false;

    /**
     * the time of expire, default 30 days
     */
    long expire() default 30L;

    /**
     * the time unit of expire, default day
     */
    TimeUnit unit() default TimeUnit.DAYS;
}
